<script type="text/javascript" src="<?php echo js_url() . "chat.js"; ?>" >
</script>
<script type="text/javascript" src="<?php echo js_url() . "bootstrap.min.js"; ?>" >
</script>
<script type="text/javascript">
    var notifNumber = <?php echo $notifsNumber; ?>;
    var whatsUpUrl = "<?php echo site_url("notifications/whatsUp/"); ?>" + "/";
    var sendUrl = "<?php echo site_url("chat/send"); ?>";
    var newsUrl = "<?php echo site_url("chat/getNews"); ?>";
    var withUrl = "<?php echo site_url("chat/with"); ?>";
    var tofsUrl = "<?php echo css_url("chat/with") . "../pht/"; ?>";
    var delNotifsUrl = "<?php echo site_url("chat/delNotifs"); ?>";
    var plusUrl = "<?php echo site_url("chat/plus"); ?>";
    var imgUrl = "<?php echo img_url("chat/with"); ?>";
    var connections = "<?php echo $connections; ?>";
    $(document).ready(function() {
        loadChatWith("<?php echo $last_with; ?>");
        console.log("tofsUrl = " + tofsUrl);
        $("#frm_chat_sub").click(function() {
            send("frm_chat");
            return false;
        });
        $("#search").focus();
        //Pour les notifications
        update(notifNumber);
        ajaxStop();
    });

    function popupImage(url) {
//        $("<img src='" + url + "' />").bPopup({
//            position: [150, 20],
//            modalClose: true,
//            positionStyle: 'fixed'
//        });
        $('#divModal').html("<img src='" + url + "' />").modal();
    }
    
</script>

<div class="span5">
    <div class="row" id="socialDiv" >
        <?php
        $this->load->view("v_users");
        ?>
    </div>
</div>
<div class="span3 rounded" style="height: 572px">
    <!--<img src="<?php echo img_url() . "pub.png"; ?>"/>-->
    <?php
    $this->load->view("v_friends");
    ?>
</div>

<div class="span4">
    <div class="row">
        <div class="span4 rounded" id="chatingWith">

        </div>
    </div>
    <div class="row">
        <div  class="span4 rounded" id="discussion" >
            <?php
//            if (isset($discussion)) {
//                foreach ($discussion as $row) {
//                    $this->load->view("message", array('msg' => $row));
//                }
//            }
            ?>
        </div>
    </div>
    <div class="row">
        <div class="span4" >
            <?php
            echo form_open("chat/send", array("id" => "frm_chat"));
            ?>
            <div class="input-append">
                <textarea  id="chatText"  name="message" class="input-large" rows="2"></textarea>
                <button class="btn btn-primary" type="submit" id="frm_chat_sub" style="height:50px;">
                    Send  <i class="icon-white icon-ok"></i>
                </button>
            </div>
            <input type="hidden" value="" id="withId" name="with"  />
            <?php
            echo form_close();
            ?>
        </div>
    </div>
</div>
        
<div id="divModal"  class="modal hide fade" style="text-align: center" >
</div>
